package manager;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import InterfazRemota.InterfazRemota;



public class AdministradorEmpleado {
	
	private InterfazRemota ir;
	private static AdministradorEmpleado instancia;
	
	public static AdministradorEmpleado getInstancia()
	{
		if(instancia==null)
			instancia = new AdministradorEmpleado();
		return instancia;
	}
	
	private AdministradorEmpleado()
	{
		try {
			ir = (InterfazRemota) Naming.lookup("TPO_Restaurante");
			
			
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (NotBoundException e) {
			e.printStackTrace();
		}
	}
	
	public  boolean autoUsu(String UserID,String PassWord) {
		try {
			return ir.authenticateUser(UserID, PassWord);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return false;

	}

}
